<!--<?php
include_once PrintEot('left');
if(empty($action)){print <<<EOT
-->
<h2><b>提示信息</b></h2>
<ul class="tr5">
为了保证空间的可持续发展,请及时清理!附件保存目录为:<span class="xia">$attachpath</span><br><b class="s2">功能说明</b>: 本功能根据数据库中的附件记录搜索,  删除符合条件的附件和附件记录, 释放更多的数据库空间和服务器空间<br>
</ul>
<form action="$basename&" method=post name="form1">
<input type=hidden name=action value=search>
<h3><b>附件编辑</b></h3>
<table cellspacing="0" cellpadding="0" width="100%">
<tr class="tr3"><td width=20%>所属版块</td>
<td><select name='fid'><option value=all>所有版块</option>$forumcache</select></td></tr>
<tr class="tr3"><td width=20%>用户名</td>
<td><input type="text" class="input" size="20" name="username"></td></tr>
<tr class="tr3"><td width=20%>文件名包含</td>
<td><input type="text" class="input" size="20" name="filename"></td></tr>
<tr class="tr3"><td>下载次数</td>
<td><input type="text" class="input" size="20" name="hits">
<input type="radio" size="20" name="ifmore" value='1' checked>小于
<input type="radio" size="20" name="ifmore" value='0'>大于
</td></tr>
<tr class="tr3"><td>附件大小(K) </td>
<td><input type="text" class="input" size="20" name="filesize">
<input type="radio" name="ifless" value='1' checked>小于
<input type="radio" name="ifless" value='0'>大于
</td></tr>
<tr class="tr3"><td>上传时间 </td>
<td><input type="text" class="input" size="20" name="postdate1" value="2004-01-01"> - <input type="text" class="input" size="20" name="postdate2" value="$postdate2">
</td></tr>
<tr class="tr3"><td>排序</td>
<td><select name='orderway'>
<option value='uploadtime'>上传时间</option>
<option value='size'>附件大小</option>
<option value='rvrc'>所需{$db_rvrcname}</option>
<option value='name'>附件名</option>
<option value='hits'>下载次数</option>
</select>
<input type="radio" name="asc" value=''>升序
<input type="radio" name="asc" value='DESC' checked>降序</td></tr>
	<tr class="tr3">
		<td><div id="info1">每页显示个数</div></td>
		<td>
			<input type="text" class="input" size="10" name="pernum" value="20">
			<input type="checkbox" id="direct" name="direct" value=1 onclick="deldirect(this.form,'info1','每页显示个数');">
			直接删除符合条件的附件
		</td>
	</tr>
</table>
<br><center><input type=submit class="btn" value="提 交"></center><br><br></form>
<div class="c"></div>
<h2><b>提示信息</b></h2>
<div class="tr5">
<b class="s1">功能说明</b>:本功能可根据附件最后被访问时间搜索整个论坛的附件, 选择删除长时间没人访问的附件, 可有效清理论坛中冗余附件, 从而释放更多的服务器空间.<br><b class="s2">注</b>:如果你要删除的附件比较多,可以使用直接删除功能, 直接删除符合搜索条件的附件
</div>
<form action="$basename&" method="post" name="form2">
<input type="hidden" name="action" value="schdir">
<h3><b>附件编辑</b> <a href="$basename&action=list" class="w" style="margin-left:1em;">查看上次搜索结果</a></h3>
<table cellspacing="0" cellpadding="0" width="100%">

<tr class="tr3"><td width=20%>文件名包含</td>
<td><input type="text" class="input" size="20" name="filename"></td></tr>
<tr class="tr3"><td>附件大小(K) </td>
<td><input type="text" class="input" size="20" name="filesize">
<input type="text" class="input" size="20" name="ifless" value='1' checked>小于
<input type="text" class="input" size="20" name="ifless" value='0'>大于
</td></tr>
<tr class="tr3"><td>最后访问时间 </td>
<td><input type="text" class="input" size="20" name="postdate1" value="2004-01-01"> - <input type="text" class="input" size="20" name="postdate2" value="$postdate2"></td></tr>
<tr class="tr3"><td><div id="info2">每次跳转处理个数</div></td>
<td><input type="text" class="input" size="20" name="pernum" value=1000><input type=checkbox id="direct" name="direct" value=1 onclick="deldirect(this.form,'info2','每次跳转处理个数');">直接删除符合条件的附件</td></tr>
</table>
<br><center><input type="submit" value="提 交" class="btn"></center></form>
<br>
<form action="$basename&" method="post" name="form2">
<input type="hidden" name="action" value="delattach">
<h2><b>附件编辑</b></h2>
<table cellspacing="0" cellpadding="0" width="100%">
	<tr class="tr3"><td colspan=2></td></tr>
	<tr class="tr3"><td colspan=2>本功能将搜索整个论坛的附件，删除数据库中没有记录而实际存在的附件，可有效清理论坛中冗余附件, 从而释放更多的服务器空间.</td></tr>
	<tr class="tr3">
		<td width=20%>每次跳转处理个数</td>
		<td><input type="text" class="input" size="20" name="pernum" value="1000"></td>
	</tr>
</table>
<br>
<center><input type=submit class="btn" value="提 交"></center></form>
<br />
<br />
<script language="JavaScript">
function deldirect(form,tar,msg){
	if (form.direct.checked == true){
		document.getElementById(tar).innerHTML = '<b><font color=blue>删除个数</font></b>';
	}else{
		document.getElementById(tar).innerHTML = msg;
	}
}
</script>
<!--
EOT;
}elseif($action=='list'){print <<<EOT
-->
<form action="$basename&" method="post">
<input type="hidden" name="action" value="delfile">
<h2><b>论坛附件</b></h2>
<table cellspacing="0" cellpadding="0" width="100%">
<tr class="tr3" align="center">
<td>ID</td>
<td>附件名</td>
<td>最后访问时间</td>
<td>附件大小(k)</td>
<td width=4%>删</td>
</tr>
<!--
EOT;
$id=($page-1)*$db_perpage;
foreach($attachdb as $attach){
$id++;
print <<<EOT
-->
<tr class="tr3" align="center">
<td>$id</td>
<td><a href="$attachpath/$attach[name]" target="_blank">$attach[name]</a></td>
<td>$attach[time]</td>
<td>$attach[size]</td>
<td>
<!--
EOT;
if($attach[exists]){print <<<EOT
-->
<input type="checkbox" name="delfile[]" value="$attach[name]">
<!--
EOT;
}else{print <<<EOT
-->
<font color="red">已删</font>
<!--
EOT;
}print <<<EOT
-->
</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table><br>$pages
<div class="c"></div>
<center><input type="button" name="chkall" class="btn" value="全 选" onclick="CheckAll(this.form)">
<input type="submit" name="hello" value="提 交" class="btn"></center></form><br/>
<!--
EOT;
}else{print <<<EOT
-->
<form action="$basename&" method="post">
<input type="hidden" name="action" value="delete"> 
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td class="tr2" colspan="7"><b>论坛附件</b></td></tr>
<tr class="tr3 s2" align="center">
<td>ID</td>
<td width="20%">附件名</td>
<td width="15%">附件大小</td>
<td width="15%">上传时间</td>
<td width="20%">所在主题</td>
<td width="20%">所属版块</td>
<td width=4%>删</td>
</tr>
<!--
EOT;
$id=($page-1)*$pernum;
foreach($attachdb as $key=>$value){
$view_topic=$value[tid]?"<a href='read.php?tid=$value[tid]' target='_blank'>所在主题</a>":'-';
$id++;
print <<<EOT
-->
<tr class="tr3" align="center">
<td>$id</td>
<td><a href="$attachpath/$value[url]" target="_blank">$value[name]</a></td>
<td>$value[filezie]</td>
<td>$value[uploadtime]</td>
<td>$view_topic</td>
<td><a href="$value[where]" target="_blank">$value[forum]</a></td>
<td><input type='checkbox' name='aidarray[]' value="$value[aid]"></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table><br>$pages
<div class="c"></div>
<center><input type="button" class="btn" name="chkall" value="全 选" onclick="CheckAll(this.form)">
<input type="submit" name="hello" value="提 交" class="btn"></center></form>
<br/>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->